<template>
  <el-row>
<!--    <el-button type="primary" style="margin-bottom: 12px">添加</el-button>-->
    <el-table :data="tableData" class="table-body" :header-cell-style="{background:'#F4F6F9',color:'#1D2129'}">
      <el-table-column type="index" width="50"></el-table-column>
      <el-table-column prop="name" label="模块名称" width="220"></el-table-column>
      <el-table-column prop="given_name" label="角色列表" width="220"></el-table-column>
      <el-table-column prop="gender" label="描述"></el-table-column>
      <el-table-column prop="age" label="更新时间" width="220"></el-table-column>
      <el-table-column prop="age" label="更新账号" width="220"></el-table-column>
      <el-table-column label="操作" width="120" fixed="right">
        <template slot-scope="scope">
          <el-button type="text" @click="handleCheck(scope.row)">查看</el-button>
          <el-button type="text" @click="handleCheck(scope.row)">角色</el-button>
<!--          <el-button type="text" @click="handleCheck(scope.row)">删除</el-button>-->
<!--          <el-button type="text" @click="handleCheck(scope.row)">禁用</el-button>-->
        </template>
      </el-table-column>
    </el-table>
    <Pagination :count="100" :current="1" @handleSizeChange="handleSizeChange"
                @handleCurrentChange="handleCurrentChange"/>
  </el-row>
  <!--    <el-row :gutter="20">-->
  <!--      <el-col :span="6" :offset="18" style="text-align: right">-->
  <!--        <el-button>默认按钮</el-button>-->
  <!--        <el-button type="primary">主要按钮</el-button>-->
  <!--      </el-col>-->
  <!--    </el-row>-->
</template>

<script>
import { mapMutations } from "vuex";
import Pagination from "@/components/Pagination.vue";

export default {
  components: { Pagination },
  data() {
    return {
      labelPosition: 'right',
      tableData: [
        {
          id: 1,
          name: '新闻资讯'
        },
        {
          id: 2
        },
      ],

      formLabelAlign: {
        name: '',
        region: '',
        type: ''
      }
    };
  },
  methods: {
    ...mapMutations('base', ['setBreadcrumb']),
    async getData() {

    },
    handleSizeChange(limit) {
      this.form.limit = limit
      this.current = 1
      this.getData()
    },
    handleCurrentChange(offset) {
      this.form.offset = offset === 0 ? 0 : offset !== 0 ? Number(offset - 1) * this.form.limit : 0
      this.getData()
    },
    handleCheck() {
      this.$router.push({path: '/user/info'})
      this.setBreadcrumb([{
        name: '人员',
        path: '/user'
      }, {
        name: '人员详情',
        path: '/user/info'
      }])
    }
  }
}
</script>
